package com.example.demo.schedule;

import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Component
@EnableScheduling
public class GetBusinessList implements Runnable {


  @Autowired
  private UserService userService;


  public GetBusinessList() {
  }

//    @Scheduled(cron = "0 0/2 * * * ?") //两分钟执行一次
  public void run() {
    this.pushDataScheduled();
  }


  public void pushDataScheduled() {
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    System.out.println(df.format(new Date()) + ":开始获取业务数据");

    {
      //定时业务模块

    }


    System.out.println(df.format(new Date()) + ":业务数据更新完成");
//    userService.userSendFormat();



  }


}
